<template>
  <PageWrapper contentFullHeight>
    <ListTemplate
      :register-table="registerTable"
      addauth="system:auxiliary:iet-category:add"
      :method="methods"
    />
    <Handle @register="registerLayer" @success="tableMethods.reload" />
  </PageWrapper>
</template>
<script setup lang="ts">
  import ListTemplate from '@/views/common/operate/listTemplate.vue';

  import ApiV1 from '@/views/common/operate/ApiV1';
  import { createAsyncComponent } from '@/utils/factory/createAsyncComponent';

  import PageWrapper from '@/components/Page/src/PageWrapper.vue';
  import {
    apiGetIetCategoryDeletePath,
    apiPostIetCategoryListQuery,
  } from '@/api/http/system/auxiliary/iet-category/iet-category.api';
  import {
    useIetCategoryListColumns,
    useIetCategoryListSearchForm,
  } from '@/api/http/system/auxiliary/iet-category/iet-category.data';

  defineOptions({
    name: 'SystemIetCategoryList',
  });
  const Handle = createAsyncComponent(() => import('./handle.vue'));
  const { registerTable, registerLayer, methods, tableMethods } = ApiV1.useList({
    tableProps: {
      api: apiPostIetCategoryListQuery,
      columns: useIetCategoryListColumns(),
      formConfig: {
        schemas: useIetCategoryListSearchForm(),
      },
    },
    editActionItem: {
      auth: 'system:auxiliary:iet-category:edit',
    },
    delActionItem: {
      auth: 'system:auxiliary:iet-category:delete',
    },
    mode: 'model',
    delFN: apiGetIetCategoryDeletePath,
    auth: 'system:auxiliary:iet-category:list',
  });
</script>
